<?php
$originRoot = "E:\\wwwgit\\www.jjhgame.com\\";
$targetRoot = "E:\\wwwgit\\wwwgt\\2\\www.jjhgame.com\\";

// $originRoot = "E:\\wwwgit\\img02.jjhgame.com\\";
// $targetRoot = "E:\\wwwgit\\wwwgt\\2\\img02.jjhgame.com\\";

$fileSet = "src/House/HouseBundle/Controller/SoftDown/SoftDownController.php
src/House/HouseBundle/CustomerClass/Constants/SqlMapper/SoftDownSqlMapper.php
src/House/HouseBundle/CustomerClass/HelperClass/SoftDown/SoftDownClass.php
src/House/HouseBundle/Resources/config/softdown/softdown.xml";
// $fileSet = "main/game1511/js/live_newest/Video.js
// main/game1512/h5/js/h5RoomLive.js
// main/game1512/live/js/index/H5Player.js
// main/game1512/js/usercenter/Data.js
// main/game1512/live/js/bundle.js
// main/game1511/js/live_newest/Gift.js
// main/game1512/js/show_newest/search.js
// main/game1511/js/live_newest/App.js
// main/game1511/js/live_newest/DataControll.js
// main/game1512/js/show_newest/anchor-plaza.js
// main/game1511/js/live_newest/exports/webSocket.js
// main/game1512/h5/js/proto.js
// main/game1511/js/live_newest/Data/compatibility.js
// main/game1511/js/live_newest/Lead.js
// main/game1512/h5/js/qs.js
// main/game1512/live/js/index/H5Execute.js
// main/game1512/js/common.js
// main/game1512/js/usercenter/favH.js
// main/game1511/js/live_newest/User.js
// main/game1511/js/live_newest/Chat.js
// main/game1511/js/live_newest/ChatMessage.js
// main/game1511/js/live_newest/exports/Welfare.js
// main/game1512/js/workman/11/crowdFund.js
// main/game1512/js/X5.2.js
// main/game1511/js/live_newest/Task/taskRecharge.js
// main/game1511/js/live_newest/Task/FreeGift.js
// main/game1511/js/live_newest/Task/SignIn.js
// main/game1511/js/live_newest/Task/TaskInterface.js
// main/game1512/js/vue/vue2-touch.js";
$fileSetArray = explode("\r\n",$fileSet);
if($fileSetArray)
{
	$index = 1;
	foreach ($fileSetArray as $key => $value) {
		echo "\r\n[ID:".$index."]\r\n";
		$logic = false;
		if(file_exists($targetRoot.$value))
		{
			echo $targetRoot.$value ." check OK\r\n";
			$logic = true;
		}else
		{
			echo $targetRoot.$value ." check miss\r\n";
			$logic = false;
		}
		$index++;
		$result = false;
		try{
			$fileDir  = dirname($targetRoot.$value);
			echo $fileDir;
			if(!file_exists($fileDir))
			{
				@mkdir($fileDir,0777,true);
			}
			$result = copy($originRoot.$value,$targetRoot.$value);

		}catch (Exception $ex) {
            
        }
        echo $logic == true ? "[update]":"[add]";
        echo $result  == true ? "-->success":"-->fail\r\n";

	}
}